<!--
 * @Descripttion: 
 * @version: 
 * @Author: 王政乔(https://www.zhengqiao.wang/)
 * @Date: 2020-03-25 10:59:52
 * @LastEditors: 王政乔(https://www.zhengqiao.wang/)
 * @LastEditTime: 2020-04-12 19:47:37
 -->
<!DOCTYPE html>
<html  lang="zh">
<head>
    
    <link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">

    <style>
        body {
            cursor: url("http://pic.zhengqiao.wang/Arrow.cur"), auto !important;
        }
    
        a:hover {
            cursor: url("http://pic.zhengqiao.wang/Hand.cur"), auto !important;
        }
        input:hover{
            cursor: url("http://pic.zhengqiao.wang/IBeam.cur"), auto !important;
        }
        .pace .pace-progress {
            background: #1E92FB; /*进度条颜色*/
            height: 3px;
        }
        .pace .pace-progress-inner {
            box-shadow: 0 0 10px #1E92FB, 0 0 5px     #1E92FB; /*阴影颜色*/
        }
        .pace .pace-activity {
            border-top-color: #1E92FB;    /*上边框颜色*/
            border-left-color: #1E92FB;    /*左边框颜色*/
        }
    </style>
    <!--
 * @Descripttion: 
 * @version: 
 * @Author: 王政乔(https://www.zhengqiao.wang/)
 * @Date: 2020-03-25 10:59:52
 * @LastEditors: 王政乔(https://www.zhengqiao.wang/)
 * @LastEditTime: 2020-05-06 19:55:13
 -->
<meta charset="utf-8" />

<meta name="generator" content="Hexo 4.2.0" />

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

<title>STM32：基于红外遥控的声光系统 - 王政乔|中国</title>
<!-- iconfont -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1734413_xyuugyshzlp.css">

    <meta name="description" content="大实验 基于红外遥控的声光系统 我终于来填坑了，之前说的要把开源项目的代码一一讲解，不过一直因为懒，所以没做。 疫情期间实在太无聊了，就把实验报告拉过来了，里面讲解还是挺详细的，可以看。 B站演示视频已经上传了，需要看演示的可以翻阅到最后附录处查看。">
<meta property="og:type" content="article">
<meta property="og:title" content="STM32：基于红外遥控的声光系统">
<meta property="og:url" content="https://www.zhengqiao.wang/2020-3-31-STM32%EF%BC%9A%E5%9F%BA%E4%BA%8E%E7%BA%A2%E5%A4%96%E9%81%A5%E6%8E%A7%E7%9A%84%E5%A3%B0%E5%85%89%E7%B3%BB%E7%BB%9F/index.html">
<meta property="og:site_name" content="王政乔|中国">
<meta property="og:description" content="大实验 基于红外遥控的声光系统 我终于来填坑了，之前说的要把开源项目的代码一一讲解，不过一直因为懒，所以没做。 疫情期间实在太无聊了，就把实验报告拉过来了，里面讲解还是挺详细的，可以看。 B站演示视频已经上传了，需要看演示的可以翻阅到最后附录处查看。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://www.zhengqiao.wang/images/og_image.png">
<meta property="article:published_time" content="2020-03-31T05:29:00.000Z">
<meta property="article:modified_time" content="2020-03-31T12:20:16.845Z">
<meta property="article:author" content="王政乔">
<meta property="article:tag" content="嵌入式 - STM32">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://www.zhengqiao.wang/images/og_image.png">







<link rel="icon" href="http://pic.zhengqiao.wang/20200301103642.jpg">


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.7.2/css/bulma.css">

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/atom-one-light.css">


    
    
<style>body>.footer,body>.navbar,body>.section{opacity:0}</style>

    
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">

    
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">

    
    
    
    
<link rel="stylesheet" href="/css/back-to-top.css">

    
    
    
    <script>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "//hm.baidu.com/hm.js?c62b048aa4e4e717dbea80aaaab32c9e";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
</script>
    
    
    
    <link rel="stylesheet" href="/css/progressbar.css">
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>
    
    
    


<link rel="stylesheet" href="/css/style.css">
</head>
<body class="is-3-column">
    <script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
    
        <canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none;"></canvas>
        <script type="text/javascript" src="//cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script>
        <script type="text/javascript" src="/js/fireworks.js"></script>
    
    <!--
 * @Descripttion: 
 * @version: 
 * @Author: 王政乔(https://www.zhengqiao.wang/)
 * @Date: 2020-03-25 10:59:52
 * @LastEditors: 王政乔(https://www.zhengqiao.wang/)
 * @LastEditTime: 2020-04-04 10:57:37
 -->
<nav class="navbar navbar-main">
    <div class="container">
        <div class="navbar-brand is-flex-center">
            <a class="navbar-item navbar-logo" href="/">
            
                王政乔|中国
            
            </a>
        </div>
        <div class="navbar-menu">
            
            <div class="navbar-start">
                
                <a class="navbar-item"
                href="/">主页</a>
                
                <a class="navbar-item"
                href="/archives">文章列表</a>
                
                <a class="navbar-item"
                href="/about">关于我</a>
                
                <a class="navbar-item"
                href="/gallary">图集</a>
                
                <a class="navbar-item"
                href="/jogertools">政乔工具库</a>
                
            </div>
            
            <div class="navbar-end">
                
                    
                    <a class="navbar-item" target="_blank" rel="noopener" title="访问我的Gitee" href="https://gitee.com/JogerQiao">
                        
                        <i class="iconfont icon-gitee-fill-round"></i>
                        
                    </a>
                    
                    <a class="navbar-item" target="_blank" rel="noopener" title="我的邮箱" href="mailto:me@zhengqiao.wang">
                        
                        <i class="iconfont icon-mail"></i>
                        
                    </a>
                    
                    <a class="navbar-item" target="_blank" rel="noopener" title="Bilibili" href="https://space.bilibili.com/83542572">
                        
                        <i class="iconfont icon-bilibili-line"></i>
                        
                    </a>
                    
                    <a class="navbar-item" target="_blank" rel="noopener" title="知乎" href="https://www.zhihu.com/people/joger-81">
                        
                        <i class="iconfont icon-zhihu"></i>
                        
                    </a>
                    
                
                
                <a class="navbar-item is-hidden-tablet catalogue" title="目录" href="javascript:;">
                    <i class="fas fa-list-ul"></i>
                </a>
                
                
                <a class="navbar-item search" title="搜索" href="javascript:;">
                    <i class="iconfont icon-search"></i>
                </a>
                
            </div>
        </div>
    </div>
</nav>
    
    <section class="section">
        <div class="container">
            <div class="columns">
                <div class="column is-8-tablet is-8-desktop is-6-widescreen has-order-2 column-main">
<div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2020-03-31T05:29:00.000Z">2020年03月31日</time>
                
                <div class="level-item">
                <a class="has-link-grey -link" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/">课程设计</a>&nbsp;/&nbsp;<a class="has-link-grey -link" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/%E5%B5%8C%E5%85%A5%E5%BC%8F/">嵌入式</a>
                </div>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    37 分钟 读完 (大约 5491 个字)
                </span>
                
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                STM32：基于红外遥控的声光系统
            
        </h1>
        <div class="content">
            <h2 id="大实验-基于红外遥控的声光系统"><a href="#大实验-基于红外遥控的声光系统" class="headerlink" title="大实验 基于红外遥控的声光系统"></a>大实验 <strong>基于红外遥控的声光系统</strong></h2><blockquote>
<p>我终于来填坑了，之前说的要把开源项目的代码一一讲解，不过一直因为懒，所以没做。</p>
<p>疫情期间实在太无聊了，就把实验报告拉过来了，里面讲解还是挺详细的，可以看。</p>
<p>B站演示视频已经上传了，需要看演示的可以翻阅到最后附录处查看。</p>
</blockquote>
<a id="more"></a>

<p>代码地址：</p>
<p><a href="https://gitee.com/JogerQiao/ATK_STM32_20191218_Acoustooptic_system_of_infrared_remote_control.git">https://gitee.com/JogerQiao/ATK_STM32_20191218_Acoustooptic_system_of_infrared_remote_control.git</a></p>
<p>演示地址：</p>
<p><a href="https://www.bilibili.com/video/BV1Mp4y1C78h/">https://www.bilibili.com/video/BV1Mp4y1C78h/</a></p>
<p>在线观看：</p>
<div>
    <iframe src="//player.bilibili.com/player.html?aid=967602683&bvid=BV1Mp4y1C78h&cid=172004330&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" width="100%" height="300px"> </iframe>
</div>



<p>计科4班 20160520126 王政乔</p>
<h3 id="1-实验目的"><a href="#1-实验目的" class="headerlink" title="1.实验目的"></a>1.实验目的</h3><p>综合本学期所学习的相关知识，将本学期所学知识尽可能整合成一套系统并实现。</p>
<h3 id="2-项目名称"><a href="#2-项目名称" class="headerlink" title="2.项目名称"></a>2.项目名称</h3><p>基于红外遥控的声光系统。</p>
<h3 id="3-项目内容"><a href="#3-项目内容" class="headerlink" title="3.项目内容"></a>3.项目内容</h3><p>使用红外遥控器控制STM32开发板上的LED和蜂鸣器以不同的模式（流水灯模式、闪灯模式）和频率（7挡位）工作，同时在LCD显示屏上进行显示交互。</p>
<h3 id="4-项目设备"><a href="#4-项目设备" class="headerlink" title="4.项目设备"></a>4.项目设备</h3><p>STM32战舰版（个人的）。</p>
<p>ATK遥控器。</p>
<p>ST-LINK。</p>
<h3 id="5-实现功能和涉及技术"><a href="#5-实现功能和涉及技术" class="headerlink" title="5.实现功能和涉及技术"></a>5.实现功能和涉及技术</h3><h4 id="功能描述"><a href="#功能描述" class="headerlink" title="功能描述"></a>功能描述</h4><p>通过红外接收器信号设置定时器4中断并将信号缓存到全局变量中，主程序通过轮询方式查询红外信号，并根据红外信号控制定时器3和定时器5。其中定时器3为LED定时器，控制LED的频闪频率、模式，并根据定时器3的初始化计数值和分频值设置LED的频率。定时器5为蜂鸣器定时器，控制蜂鸣器的频率，并根据定时器5的初始化数值和分频值设置蜂鸣器的频率。在控制的过程中，使用LCD屏幕显示当前的开关运行状态、模式（LED模式/蜂鸣器模式）、频率挡位（7挡位）。</p>
<p>LED和蜂鸣器的挡位使用ATK红外遥控器的LEFT和RIGHT切换并循环；LED和蜂鸣器两个模式使用ATK红外遥控器的TOP和BOTTOM切换并循环；LED的流水灯模式和闪灯模式使用ATK红外遥控器的数字1和2切换；程序的开关使用ATK红外遥控器的POWER切换。</p>
<h4 id="涉及技术"><a href="#涉及技术" class="headerlink" title="涉及技术"></a>涉及技术</h4><p>定时器技术：LED控制；红外信号接收；蜂鸣器控制。</p>
<p>中断：LED控制；红外信号接收；蜂鸣器控制。</p>
<p>USART：串口调试。</p>
<p>GPIO：LED控制；蜂鸣器控制。</p>
<p>LCD：LCD显示（使用了ATK官方库）。</p>
<h3 id="6-逻辑和流程图"><a href="#6-逻辑和流程图" class="headerlink" title="6.逻辑和流程图"></a>6.逻辑和流程图</h3><p>流程图如下所示，其中：</p>
<p>表6.1：流程图中变量的描述</p>
<table>
<thead>
<tr>
<th><strong>变量名称</strong></th>
<th><strong>描述</strong></th>
<th><strong>取值意义</strong></th>
<th><strong>代码变量名映射</strong></th>
</tr>
</thead>
<tbody><tr>
<td>FLAG</td>
<td>用于标记是否接收到有效的红外信号。</td>
<td>TRUE：接收到有效红外信号。  FALSE：暂未接收到有效信号。</td>
<td>power_on_init_flag</td>
</tr>
<tr>
<td>ModelFlag</td>
<td>用于标记当前的模式为LED模式还是蜂鸣器模式。</td>
<td>1：蜂鸣器模式  2：LED模式  ModelFlag只允许在1和2之间切换。</td>
<td>status</td>
</tr>
<tr>
<td>SpeedFlag</td>
<td>用于标记当前频率，可用于LED和蜂鸣器模式。</td>
<td>0<del>6：不同挡位  SpeedFlag只允许在0</del>6循环切换。</td>
<td>led_flash_tim</td>
</tr>
<tr>
<td>PowerFlag</td>
<td>用于标记当前设备是否运行。</td>
<td>TRUE：当前设备运行中。  FALSE：当前设备停止运行。</td>
<td>power</td>
</tr>
<tr>
<td>LEDModelFlag</td>
<td>用于标记LED为流水灯模式还是频闪模式</td>
<td>1：频闪模式  2：流水灯模式  LEDModelFlag只允许在1和2之间切换。</td>
<td>led_mode</td>
</tr>
</tbody></table>
<p>具体如下图6.1、6.2、6.3、6.4所示</p>
<p>图6.1：主程序流程图-1</p>
<p><img src="http://pic.zhengqiao.wang/20200331131506.png" alt=""></p>
<p>图6.2：主程序流程图-2</p>
<p><img src="http://pic.zhengqiao.wang/20200331131529.png" alt=""></p>
<p>图6.3：主程序流程图-3</p>
<p><img src="http://pic.zhengqiao.wang/20200331131545.png" alt=""></p>
<p>图6.4：主程序流程图-4</p>
<p><img src="http://pic.zhengqiao.wang/20200331131559.png" alt=""></p>
<h3 id="7-核心代码说明"><a href="#7-核心代码说明" class="headerlink" title="7.核心代码说明"></a>7.核心代码说明</h3><p>为了方便介绍，我下面将模块的.h文件和.c文件合并成一个文件进行讲解。且只对部分内容进行说明，后附有全部文件。 </p>
<h4 id="Main-c"><a href="#Main-c" class="headerlink" title="Main.c"></a>Main.c</h4><p>先将所需要的头文件一并引用：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"led.h"</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"delay.h"</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"key.h"</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"sys.h"</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"lcd.h"</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"usart.h"</span>  </span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"remote.h"</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"timer.h"</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"beep.h"</span></span></span><br></pre></td></tr></table></figure>

<p>​    接下来定义无符号8位变量key保存红外读取到的数据；power_on_init_flag保存key有效标记；status保存模式标记；vol保存频率标记；last_key保存上一次的key值用于去重；led_flash_tim[7]用于保存7档频率；power用于保存开关标记；led_mode用于保存LED显示模式。</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">u8 key;</span><br><span class="line">u8 power_on_init_flag = <span class="number">0</span>;</span><br><span class="line">u8 status = <span class="number">2</span>;       *<span class="comment">//status 1**蜂鸣器* *2LED**灯*</span></span><br><span class="line">u8 vol = <span class="number">0</span>;         *<span class="comment">//**设置频率*</span></span><br><span class="line">u8 last_key = <span class="number">0</span>;</span><br><span class="line"><span class="keyword">int</span> led_flash_tim[<span class="number">7</span>] = &#123;<span class="number">14999</span>,<span class="number">9999</span>,<span class="number">4999</span>,<span class="number">3999</span>,<span class="number">2999</span>,<span class="number">1999</span>,<span class="number">499</span>&#125;;</span><br><span class="line">u8 power = <span class="number">0</span>;          *<span class="comment">//power 0**关闭* *1**开启*</span></span><br><span class="line">u8 led_mode = <span class="number">1</span>;</span><br></pre></td></tr></table></figure>

<p>调用各个模块的init函数进行初始化操作（具体细节下面会说）：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">delay_init();           <span class="comment">//延时函数初始化    </span></span><br><span class="line">NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);<span class="comment">//设置中断优先级分组为组2：2位抢占优先级，2位响应优先级</span></span><br><span class="line">uart_init(<span class="number">115200</span>);      <span class="comment">//串口初始化为115200</span></span><br><span class="line">LED_Init();              <span class="comment">//LED端口初始化</span></span><br><span class="line">LCD_Init(); </span><br><span class="line">KEY_Init();     </span><br><span class="line">Remote_Init();          <span class="comment">//红外接收初始化   </span></span><br><span class="line">BEEP_Init();</span><br></pre></td></tr></table></figure>

<p>使用LCD画出边框和文字信息（先更换画笔颜色再写）：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// LCD 显示初始化</span></span><br><span class="line">POINT_COLOR=GRAY;</span><br><span class="line">LCD_DrawRectangle(<span class="number">2</span>,<span class="number">2</span>,<span class="number">438</span>,<span class="number">40</span>);</span><br><span class="line">LCD_DrawRectangle(<span class="number">2</span>,<span class="number">40</span>,<span class="number">238</span>,<span class="number">150</span>);</span><br><span class="line">LCD_DrawRectangle(<span class="number">2</span>,<span class="number">150</span>,<span class="number">238</span>,<span class="number">318</span>);</span><br><span class="line"></span><br><span class="line">POINT_COLOR=RED;</span><br><span class="line">LCD_ShowString(<span class="number">80</span>,<span class="number">10</span>,<span class="number">200</span>,<span class="number">40</span>,<span class="number">24</span>,<span class="string">"ZZU-CS"</span>);</span><br><span class="line"> </span><br><span class="line">POINT_COLOR=BLUE;</span><br><span class="line">LCD_ShowString(<span class="number">30</span>,<span class="number">50</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"Grade 2016 Class 4"</span>);   </span><br><span class="line">LCD_ShowString(<span class="number">30</span>,<span class="number">70</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"Zhengqiao Wang"</span>);</span><br><span class="line">LCD_ShowString(<span class="number">30</span>,<span class="number">90</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"ID:20160520126"</span>);</span><br><span class="line">LCD_ShowString(<span class="number">30</span>,<span class="number">110</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"Guolin Xiang"</span>);</span><br><span class="line">LCD_ShowString(<span class="number">30</span>,<span class="number">130</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"ID:20160690510"</span>);</span><br><span class="line"></span><br><span class="line">POINT_COLOR=RED;        <span class="comment">//设置字体为红色</span></span><br><span class="line">LCD_Draw_ALLCircle(<span class="number">30</span>,<span class="number">170</span>,<span class="number">10</span>);</span><br><span class="line">LCD_ShowString(<span class="number">50</span>,<span class="number">160</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"POWER OFF"</span>);</span><br><span class="line"></span><br><span class="line">POINT_COLOR=BLACK;</span><br><span class="line">LCD_ShowString(<span class="number">30</span>,<span class="number">200</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"Current Mode:"</span>);</span><br><span class="line">LCD_ShowString(<span class="number">30</span>,<span class="number">220</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"Current Speed:"</span>);</span><br></pre></td></tr></table></figure>

<p>接下来以一个死循环进入主程序：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">while</span>(<span class="number">1</span>)</span><br><span class="line">    &#123;…&#125;</span><br></pre></td></tr></table></figure>

<p>在主程序中，每次循环就从方法中获取当前红外数据：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">key=Remote_Scan();</span><br></pre></td></tr></table></figure>

<p>并添加两个判断用于判断是否获得了数据和去重：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(key)</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">if</span> (key == last_key) <span class="keyword">continue</span>;  <span class="comment">//去重</span></span><br></pre></td></tr></table></figure>

<p>接下来使用switch语句通过判断key的值来改变flag，该部分细节见图6.2。</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">switch</span>(key)</span><br><span class="line">            &#123;</span><br><span class="line">                <span class="keyword">case</span> <span class="number">162</span>:       <span class="comment">//POWER</span></span><br><span class="line">                    <span class="keyword">if</span> (power == <span class="number">1</span>) power = <span class="number">0</span>;</span><br><span class="line">                    <span class="keyword">else</span> power = <span class="number">1</span>;</span><br><span class="line">                    <span class="keyword">break</span>;      </span><br><span class="line">                <span class="keyword">case</span> <span class="number">98</span>:        <span class="comment">//UP</span></span><br><span class="line">                    vol++;</span><br><span class="line">                    <span class="keyword">if</span> (vol &gt; <span class="number">6</span>) vol = <span class="number">0</span>;</span><br><span class="line">                    power_on_init_flag = <span class="number">1</span>;</span><br><span class="line">                    <span class="keyword">break</span>;      </span><br><span class="line">                <span class="keyword">case</span> <span class="number">2</span>:         <span class="comment">//PLAY</span></span><br><span class="line">                    power_on_init_flag = <span class="number">1</span>;</span><br><span class="line">                    <span class="keyword">break</span>;       </span><br><span class="line">                <span class="keyword">case</span> <span class="number">226</span>:       <span class="comment">//ALIENTEK</span></span><br><span class="line">                    play_successful();</span><br><span class="line">                    <span class="keyword">break</span>;        </span><br><span class="line">                <span class="keyword">case</span> <span class="number">194</span>:       <span class="comment">//RIGHT</span></span><br><span class="line">                    <span class="keyword">if</span> (status == <span class="number">1</span>) status = <span class="number">2</span>;</span><br><span class="line">                    <span class="keyword">else</span> status = <span class="number">1</span>;</span><br><span class="line">                    power_on_init_flag = <span class="number">1</span>;</span><br><span class="line">                    <span class="keyword">break</span>;     </span><br><span class="line">                <span class="keyword">case</span> <span class="number">34</span>:        <span class="comment">//LEFT</span></span><br><span class="line">                    <span class="keyword">if</span> (status == <span class="number">1</span>) status = <span class="number">2</span>;</span><br><span class="line">                    <span class="keyword">else</span> status = <span class="number">1</span>;</span><br><span class="line">                    power_on_init_flag = <span class="number">1</span>;</span><br><span class="line">                    <span class="keyword">break</span>;            </span><br><span class="line">                <span class="keyword">case</span> <span class="number">168</span>:       <span class="comment">//DOWN</span></span><br><span class="line">                    <span class="keyword">if</span> (vol == <span class="number">0</span>) vol = <span class="number">6</span>;</span><br><span class="line">                    <span class="keyword">else</span> vol--;</span><br><span class="line">                    </span><br><span class="line">                    power_on_init_flag = <span class="number">1</span>;</span><br><span class="line">                    <span class="keyword">break</span>;         </span><br><span class="line">                <span class="keyword">case</span> <span class="number">104</span>:       <span class="comment">//1</span></span><br><span class="line">                    <span class="built_in">printf</span>(<span class="string">"\r\n--model 1--\r\n"</span>);</span><br><span class="line">                    led_mode = <span class="number">1</span>;</span><br><span class="line">                    LED0 = <span class="number">1</span>;</span><br><span class="line">                    LED1 = <span class="number">1</span>;</span><br><span class="line">                    power_on_init_flag = <span class="number">1</span>;</span><br><span class="line">                    <span class="keyword">break</span>;</span><br><span class="line">                <span class="keyword">case</span> <span class="number">152</span>:       <span class="comment">//2</span></span><br><span class="line">                    <span class="built_in">printf</span>(<span class="string">"\r\n--model 2--\r\n"</span>);</span><br><span class="line">                    led_mode = <span class="number">2</span>;</span><br><span class="line">                    LED0=<span class="number">0</span>;</span><br><span class="line">                    LED1=<span class="number">1</span>;</span><br><span class="line">                    power_on_init_flag = <span class="number">1</span>;</span><br><span class="line">                    <span class="keyword">break</span>;</span><br><span class="line">                <span class="keyword">default</span>:        <span class="comment">//ERROR</span></span><br><span class="line">                    <span class="keyword">break</span>;</span><br><span class="line">            &#125;</span><br></pre></td></tr></table></figure>



<p>每次switch执行完，为了达到去重的目的，还需要将当前的key记录下来，以便与下一次的key判断。同时，当key为0时，则认为已经将遥控器按键松开，所以需要将last_key恢复置零：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">last_key = key;</span><br><span class="line">&#125; <span class="keyword">else</span> &#123;delay_ms(<span class="number">20</span>);last_key = <span class="number">0</span>;&#125;</span><br></pre></td></tr></table></figure>



<p>红外部分的判断和标记都已经设定好了，接下来需要开始执行部分了。</p>
<p>首先，需要判断电源标志是否开启，如果关闭则关闭所有定时器并在LCD上显示关闭信息：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> (power == <span class="number">0</span>)</span><br><span class="line">&#123;</span><br><span class="line">    <span class="comment">//关闭所有显示和蜂鸣器</span></span><br><span class="line">    LED0=<span class="number">1</span>;LED1=<span class="number">1</span>;BEEP=<span class="number">0</span>;</span><br><span class="line">    <span class="comment">//关闭所有定时器</span></span><br><span class="line">    TIM_Cmd(TIM3, DISABLE); </span><br><span class="line">    TIM_Cmd(TIM5, DISABLE); </span><br><span class="line">    <span class="comment">//LCD显示</span></span><br><span class="line">    POINT_COLOR=RED;        <span class="comment">//设置字体为红色</span></span><br><span class="line">    LCD_Draw_ALLCircle(<span class="number">30</span>,<span class="number">170</span>,<span class="number">10</span>);</span><br><span class="line">    LCD_ShowString(<span class="number">50</span>,<span class="number">160</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"POWER OFF"</span>);</span><br><span class="line">    LCD_Fill(<span class="number">130</span>,<span class="number">190</span>,<span class="number">238</span>,<span class="number">320</span>,WHITE);</span><br><span class="line">    LCD_Fill(<span class="number">0</span>,<span class="number">240</span>,<span class="number">240</span>,<span class="number">320</span>,WHITE);</span><br><span class="line">    LCD_ShowString(<span class="number">130</span>,<span class="number">200</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"     "</span>);</span><br><span class="line">    </span><br><span class="line">    </span><br><span class="line">    power_on_init_flag = <span class="number">1</span>;</span><br><span class="line">    </span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<p>如果开启则需要另外判断power_on_init_flag是否为True，否则可能是多次循环访问，由于后面的代码是以控制定时器的开关为途径控制其他LED和BEEP设备，则只需要执行一次。所以我们需要这个判断，并确定为True时在LCD上显示POWER ON 相关信息，之后会将power_on_init_flag置零：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> (power_on_init_flag)&#123;</span><br><span class="line">    <span class="comment">//LCD显示</span></span><br><span class="line">    POINT_COLOR=GREEN;      </span><br><span class="line">    LCD_Draw_ALLCircle(<span class="number">30</span>,<span class="number">170</span>,<span class="number">10</span>);</span><br><span class="line">    LCD_ShowString(<span class="number">50</span>,<span class="number">160</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"POWER  ON"</span>);</span><br><span class="line">    LCD_Fill(<span class="number">130</span>,<span class="number">190</span>,<span class="number">238</span>,<span class="number">320</span>,WHITE);</span><br><span class="line">    LCD_Fill(<span class="number">0</span>,<span class="number">240</span>,<span class="number">240</span>,<span class="number">320</span>,WHITE);</span><br><span class="line">    </span><br><span class="line">    power_on_init_flag = <span class="number">0</span>;</span><br></pre></td></tr></table></figure>



<p>接下来需要判断当前模式，status为1则蜂鸣器模式，思路可见图6.4，status为2时为LED模式，思路见图6.3。将在LCD指定位置显示当前的模式（“BEEP”或“LED”），且关闭对方的定时器和打开自己的定时器：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//判断模式</span></span><br><span class="line"><span class="keyword">switch</span>(status)</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">case</span> <span class="number">1</span>:     <span class="comment">//蜂鸣器模式</span></span><br><span class="line">        <span class="comment">//LCD显示</span></span><br><span class="line">        POINT_COLOR=GREEN;</span><br><span class="line">        LCD_ShowString(<span class="number">130</span>,<span class="number">200</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"BEEP"</span>);</span><br><span class="line">        LCD_ShowNum(<span class="number">130</span>,<span class="number">220</span>,vol+<span class="number">1</span>,<span class="number">5</span>,<span class="number">12</span>);</span><br><span class="line">        POINT_COLOR=BLACK;</span><br><span class="line">        <span class="comment">//关闭LED和初始化蜂鸣器</span></span><br><span class="line">        LED0=<span class="number">1</span>;LED1=<span class="number">1</span>;BEEP=<span class="number">0</span>;</span><br><span class="line">        <span class="comment">//关闭其他定时器</span></span><br><span class="line">        TIM_Cmd(TIM3, DISABLE); </span><br><span class="line">        <span class="comment">//打开自己定时器</span></span><br><span class="line">        TIM5_Int_Init(led_flash_tim[vol],<span class="number">800</span>);</span><br><span class="line">        <span class="keyword">break</span>;</span><br><span class="line">    <span class="keyword">case</span> <span class="number">2</span>:     <span class="comment">//LED模式</span></span><br><span class="line">        <span class="comment">//LCD显示</span></span><br><span class="line">        POINT_COLOR=GREEN;</span><br><span class="line">        LCD_ShowString(<span class="number">130</span>,<span class="number">200</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">" LED"</span>);</span><br><span class="line">        LCD_ShowNum(<span class="number">130</span>,<span class="number">220</span>,vol+<span class="number">1</span>,<span class="number">5</span>,<span class="number">12</span>);</span><br><span class="line">        LCD_ShowNum(<span class="number">130</span>,<span class="number">240</span>,led_mode,<span class="number">1</span>,<span class="number">12</span>);</span><br><span class="line">        POINT_COLOR=BLACK;</span><br><span class="line">        LCD_ShowString(<span class="number">30</span>,<span class="number">240</span>,<span class="number">200</span>,<span class="number">16</span>,<span class="number">12</span>,<span class="string">"LED Model:"</span>);</span><br><span class="line">        <span class="comment">//关闭蜂鸣器</span></span><br><span class="line">        BEEP=<span class="number">0</span>;</span><br><span class="line">        <span class="comment">//关闭其他定时器</span></span><br><span class="line">        TIM_Cmd(TIM5, DISABLE); </span><br><span class="line">        <span class="comment">//打开自己的定时器</span></span><br><span class="line">        TIM3_Int_Init(led_flash_tim[vol],<span class="number">7199</span>);</span><br><span class="line">        <span class="keyword">break</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h4 id="LED-h-LED-c"><a href="#LED-h-LED-c" class="headerlink" title="LED.h/LED.c"></a>LED.h/LED.c</h4><p>由于使用的是ATK战舰版，其LED0为PB5，LED1为PE5，为了方便之后的开发，进行了宏定义：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">define</span> LED0 PBout(5)<span class="comment">// PB5</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> LED1 PEout(5)<span class="comment">// PE5</span></span></span><br></pre></td></tr></table></figure>

<p>初始化GPIO，并使能PB和PE的端口时钟</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">GPIO_InitTypeDef  GPIO_InitStructure;</span><br><span class="line">   </span><br><span class="line">RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOE, ENABLE);  <span class="comment">//使能PB,PE端口时钟</span></span><br></pre></td></tr></table></figure>

<p>接下来配置GPIOB5，即LED0，设置推挽输出，速率为50MHz，并设置输出高：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;               <span class="comment">//LED0--&gt;PB.5 端口配置</span></span><br><span class="line">GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;        <span class="comment">//推挽输出</span></span><br><span class="line">GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;       <span class="comment">//IO口速度为50MHz</span></span><br><span class="line">GPIO_Init(GPIOB, &amp;GPIO_InitStructure);                  <span class="comment">//根据设定参数初始化GPIOB.5</span></span><br><span class="line">GPIO_SetBits(GPIOB,GPIO_Pin_5);</span><br></pre></td></tr></table></figure>

<p>同样配置GPIOE5，即LED1，设置相同：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;               <span class="comment">//LED0--&gt;PB.5 端口配置</span></span><br><span class="line">GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;        <span class="comment">//推挽输出</span></span><br><span class="line">GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;       <span class="comment">//IO口速度为50MHz</span></span><br><span class="line">GPIO_Init(GPIOE, &amp;GPIO_InitStructure);                  <span class="comment">//推挽输出 ，IO口速度为50MHz</span></span><br><span class="line">GPIO_SetBits(GPIOE,GPIO_Pin_5);                         <span class="comment">//PE.5 输出高</span></span><br></pre></td></tr></table></figure>

<h4 id="Remote-h-Remote-c"><a href="#Remote-h-Remote-c" class="headerlink" title="Remote.h/Remote.c"></a>Remote.h/Remote.c</h4><p>红外数据从PB9输入，且我的ATK遥控器识别码为0，因此宏定义：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">define</span> RDATA   PBin(9)     <span class="comment">//红外数据输入脚</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> REMOTE_ID 0</span></span><br></pre></td></tr></table></figure>

<p>在红外初始化中，由于使用了GPIO和TIM4，即使用TIM4定时器，每次定时器中断都查询一次GPIO。由于红外发射器的原理是根据捕获到下降沿后，高电平的持续时间来判断消息的，分为560us，1680us，2.5ms，4.5ms，其中560us表示接收到了0，1680us表示接收到了1，2.5ms表示接收到了上一个按键的持续，4.5ms表示接收到了引导码，因此，就可以通过在中断服务程序中写该判断即可。</p>
<p>首先需要对GPIO和TIM4进行初始化，同时对TIM4的中断初始化。</p>
<p>设置GPIOB时钟使能和TIM4时钟使能：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">GPIO_InitTypeDef GPIO_InitStructure;</span><br><span class="line">NVIC_InitTypeDef NVIC_InitStructure;</span><br><span class="line">TIM_TimeBaseInitTypeDef  TIM_TimeBaseStructure;</span><br><span class="line">TIM_ICInitTypeDef  TIM_ICInitStructure;  </span><br><span class="line"> </span><br><span class="line">RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE); <span class="comment">//使能PORTB时钟 </span></span><br><span class="line">RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4,ENABLE); <span class="comment">//TIM4 时钟使能</span></span><br></pre></td></tr></table></figure>

<p>设置GPIOB9上拉输入50MHz：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;                <span class="comment">//PB9 输入 </span></span><br><span class="line">GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPD;       <span class="comment">//上拉输入 </span></span><br><span class="line">GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;</span><br><span class="line">GPIO_Init(GPIOB, &amp;GPIO_InitStructure);</span><br><span class="line">GPIO_SetBits(GPIOB,GPIO_Pin_9); <span class="comment">//初始化GPIOB.9</span></span><br></pre></td></tr></table></figure>

<p>设置TIM4的计数器、分频和计数模式为向上计数模式</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">TIM_TimeBaseStructure.TIM_Period = <span class="number">10000</span>; <span class="comment">//设定计数器自动重装值 最大10ms溢出  </span></span><br><span class="line">TIM_TimeBaseStructure.TIM_Prescaler =(<span class="number">72</span><span class="number">-1</span>);    <span class="comment">//预分频器,1M的计数频率,1us加1.      </span></span><br><span class="line">TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; <span class="comment">//设置时钟分割:TDTS = Tck_tim</span></span><br><span class="line">TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;  <span class="comment">//TIM向上计数模式</span></span><br><span class="line"></span><br><span class="line">TIM_TimeBaseInit(TIM4, &amp;TIM_TimeBaseStructure); <span class="comment">//根据指定的参数初始化TIMx</span></span><br></pre></td></tr></table></figure>

<p>设置捕获模式为上升沿捕获，并设置映射：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">TIM_ICInitStructure.TIM_Channel = TIM_Channel_4;  <span class="comment">// 选择输入端 IC4映射到TI4上</span></span><br><span class="line">TIM_ICInitStructure.TIM_ICPolarity = TIM_ICPolarity_Rising;   <span class="comment">//上升沿捕获</span></span><br><span class="line">TIM_ICInitStructure.TIM_ICSelection = TIM_ICSelection_DirectTI;</span><br><span class="line">TIM_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV1;  <span class="comment">//配置输入分频,不分频 </span></span><br><span class="line">TIM_ICInitStructure.TIM_ICFilter = <span class="number">0x03</span>;<span class="comment">//IC4F=0011 配置输入滤波器 8个定时器时钟周期滤波</span></span><br><span class="line">TIM_ICInit(TIM4, &amp;TIM_ICInitStructure);<span class="comment">//初始化定时器输入捕获通道</span></span><br></pre></td></tr></table></figure>

<p>接着让TIM4开始工作，即使能：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">TIM_Cmd(TIM4,ENABLE );    <span class="comment">//使能定时器4</span></span><br></pre></td></tr></table></figure>

<p>接下来开始设置TIM4的中断，由于我们的所有的控制都是基于红外遥控的，因此这个中断优先级最高，设置主从优先级均为1，并使能配置：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">NVIC_InitStructure.NVIC_IRQChannel = TIM4_IRQn;  </span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = <span class="number">1</span>;  </span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannelSubPriority = <span class="number">1</span>; </span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; <span class="comment">//IRQ通道被使能</span></span><br><span class="line">NVIC_Init(&amp;NVIC_InitStructure);  <span class="comment">//根据NVIC_InitStruct中指定的参数初始化外设NVIC寄存器  </span></span><br><span class="line"></span><br><span class="line">TIM_ITConfig( TIM4,TIM_IT_Update|TIM_IT_CC4,ENABLE);<span class="comment">//允许更新中断 ,允许CC4IE捕获中断</span></span><br></pre></td></tr></table></figure>

<p>接下来便可写TIM4的中断服务程序了。</p>
<p>为了避免arr溢出中断影响，所以需要先判断是否为更新中断，如果是的话，那就清空数据即可：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(TIM_GetITStatus(TIM4,TIM_IT_Update)!=RESET)</span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">if</span>(RmtSta&amp;<span class="number">0x80</span>)                             <span class="comment">//上次有数据被接收到了</span></span><br><span class="line">    &#123;   </span><br><span class="line">        RmtSta&amp;=~<span class="number">0X10</span>;                          <span class="comment">//取消上升沿已经被捕获标记</span></span><br><span class="line">        <span class="keyword">if</span>((RmtSta&amp;<span class="number">0X0F</span>)==<span class="number">0X00</span>)RmtSta|=<span class="number">1</span>&lt;&lt;<span class="number">6</span>;    <span class="comment">//标记已经完成一次按键的键值信息采集</span></span><br><span class="line">        <span class="keyword">if</span>((RmtSta&amp;<span class="number">0X0F</span>)&lt;<span class="number">14</span>)RmtSta++;</span><br><span class="line">        <span class="keyword">else</span></span><br><span class="line">        &#123;</span><br><span class="line">            RmtSta&amp;=~(<span class="number">1</span>&lt;&lt;<span class="number">7</span>);                    <span class="comment">//清空引导标识</span></span><br><span class="line">            RmtSta&amp;=<span class="number">0XF0</span>;                       <span class="comment">//清空计数器 </span></span><br><span class="line">        &#125;                                       </span><br><span class="line">    &#125;                               </span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>接下来判断捕获中断，分别在上升沿捕获和下降沿捕获，且要求必须先上升沿捕获再下降沿捕获，以获得一个完整的波形：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(TIM_GetITStatus(TIM4,TIM_IT_CC4)!=RESET)</span><br><span class="line">&#123;     </span><br><span class="line">    <span class="keyword">if</span>(RDATA)<span class="comment">//上升沿捕获</span></span><br><span class="line">    &#123;</span><br><span class="line">        TIM_OC4PolarityConfig(TIM4,TIM_ICPolarity_Falling);                     <span class="comment">//CC4P=1    设置为下降沿捕获</span></span><br><span class="line">        TIM_SetCounter(TIM4,<span class="number">0</span>);                         <span class="comment">//清空定时器值</span></span><br><span class="line">        RmtSta|=<span class="number">0X10</span>;                           <span class="comment">//标记上升沿已经被捕获</span></span><br></pre></td></tr></table></figure>

<p>接下来捕获下降沿，捕获到下降沿后同样为了下次使用我们需要设置捕获上升沿，同时我们读取计数值到Dval变量中：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&#125;<span class="keyword">else</span> <span class="comment">//下降沿捕获</span></span><br><span class="line">&#123;</span><br><span class="line">    Dval=TIM_GetCapture4(TIM4);                 <span class="comment">//读取CCR4也可以清CC4IF标志位</span></span><br><span class="line">TIM_OC4PolarityConfig(TIM4,TIM_ICPolarity_Rising);              <span class="comment">//CC4P=0    设置为上升沿捕获</span></span><br></pre></td></tr></table></figure>

<p>接下来需要对数据进行解析，判断是否捕获到高电平，即判断第五位为1：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(RmtSta&amp;<span class="number">0X10</span>)</span><br></pre></td></tr></table></figure>

<p>如果捕获到，则判断引导码，即判断第七位为1：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(RmtSta&amp;<span class="number">0X80</span>)<span class="comment">//接收到了引导码</span></span><br></pre></td></tr></table></figure>

<p>接下来，我们根据计数器的数值来判断信号的值，由于计时不可能绝对经确且1、0、持续信号时间差异较大，因此可以使用大致时间区间来判断：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(Dval&gt;<span class="number">300</span>&amp;&amp;Dval&lt;<span class="number">800</span>)          <span class="comment">//560为标准值,560us</span></span><br><span class="line">&#123;</span><br><span class="line">    RmtRec&lt;&lt;=<span class="number">1</span>;                 <span class="comment">//左移一位.</span></span><br><span class="line">    RmtRec|=<span class="number">0</span>;                  <span class="comment">//接收到0     </span></span><br><span class="line">&#125;<span class="keyword">else</span> <span class="keyword">if</span>(Dval&gt;<span class="number">1400</span>&amp;&amp;Dval&lt;<span class="number">1800</span>)  <span class="comment">//1680为标准值,1680us</span></span><br><span class="line">&#123;</span><br><span class="line">    RmtRec&lt;&lt;=<span class="number">1</span>;                 <span class="comment">//左移一位.</span></span><br><span class="line">    RmtRec|=<span class="number">1</span>;                  <span class="comment">//接收到1</span></span><br><span class="line">&#125;<span class="keyword">else</span> <span class="keyword">if</span>(Dval&gt;<span class="number">2200</span>&amp;&amp;Dval&lt;<span class="number">2600</span>)  <span class="comment">//得到按键键值增加的信息 2500为标准值2.5ms</span></span><br><span class="line">&#123;</span><br><span class="line">    RmtCnt++;                   <span class="comment">//按键次数增加1次</span></span><br><span class="line">    RmtSta&amp;=<span class="number">0XF0</span>;               <span class="comment">//清空计时器     </span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>之后，当没有接收到引导码的时，且收到了4.5ms左右的高电平，那我们就可以认为是收到了引导码，设置第七位为1并清空按键次数：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&#125;<span class="keyword">else</span> <span class="keyword">if</span>(Dval&gt;<span class="number">4200</span>&amp;&amp;Dval&lt;<span class="number">4700</span>)      <span class="comment">//4500为标准值4.5ms</span></span><br><span class="line">&#123;</span><br><span class="line">    RmtSta|=<span class="number">1</span>&lt;&lt;<span class="number">7</span>;                   <span class="comment">//标记成功接收到了引导码</span></span><br><span class="line">    RmtCnt=<span class="number">0</span>;                       <span class="comment">//清除按键次数计数器</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>最后清空终端标记，以避免持续中断：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">TIM_ClearITPendingBit(TIM4,TIM_IT_Update|TIM_IT_CC4);</span><br></pre></td></tr></table></figure>

<p>为了方便进行数据读取，编写了方法Remote_Scan，返回红外遥控器按键数值，非0则为按下，为0则说明没有数据。</p>
<p>定义变量sta保存返回的红外数据，t1保存遥控器地址码，t2保存遥控器地址码的反码用于校验：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">u8 sta=<span class="number">0</span>;       </span><br><span class="line">u8 t1,t2;</span><br></pre></td></tr></table></figure>

<p>我们根据判断RmtSta的第六位判断是否得到了一个按键的全部信息，并给t1,t2赋值：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(RmtSta&amp;(<span class="number">1</span>&lt;&lt;<span class="number">6</span>))<span class="comment">//得到一个按键的所有信息了</span></span><br><span class="line">&#123; </span><br><span class="line">    t1=RmtRec&gt;&gt;<span class="number">24</span>;          <span class="comment">//得到地址码</span></span><br><span class="line">    t2=(RmtRec&gt;&gt;<span class="number">16</span>)&amp;<span class="number">0xff</span>;   <span class="comment">//得到地址反码</span></span><br></pre></td></tr></table></figure>

<p>为了避免串台，我们需要设置并检验遥控器识别码：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>((t1==(u8)~t2)&amp;&amp;t1==REMOTE_ID)<span class="comment">//检验遥控识别码(ID)及地址 </span></span><br><span class="line">&#123; </span><br><span class="line">    t1=RmtRec&gt;&gt;<span class="number">8</span>;</span><br><span class="line">    t2=RmtRec;  </span><br><span class="line">    <span class="keyword">if</span>(t1==(u8)~t2)sta=t1;<span class="comment">//键值正确     </span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>之后我们校验一下数据是否正确，如果出现问题将计数器RmtCnt清空即可，否则什么也不做：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>((sta==<span class="number">0</span>)||((RmtSta&amp;<span class="number">0X80</span>)==<span class="number">0</span>))<span class="comment">//按键数据错误/遥控已经没有按下了</span></span><br><span class="line">&#123;</span><br><span class="line">    RmtSta&amp;=~(<span class="number">1</span>&lt;&lt;<span class="number">6</span>);<span class="comment">//清除接收到有效按键标识</span></span><br><span class="line">    RmtCnt=<span class="number">0</span>;       <span class="comment">//清除按键次数计数器</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>最后返回sta：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">return</span> sta;</span><br></pre></td></tr></table></figure>

<h4 id="Timer-h-Timer-c"><a href="#Timer-h-Timer-c" class="headerlink" title="Timer.h/Timer.c"></a>Timer.h/Timer.c</h4><p>Timer文件中主要包含了定时器TIM3和TIM5的定义，包括定时器的初始化和定时器中断的定义，其中TIM3是用于控制LED的，TIM5是用于控制蜂鸣器的，两个在定义上相差无几，在中断的配置上基本一致，只有在中断服务程序上稍有不同。我在这里只对TIM3进行说明，TIM5可以直接类比。</p>
<p>为了初始化TIM3，我们需要先对TIM3时钟使能：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">TIM3_Int_Init</span><span class="params">(u16 arr,u16 psc)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">  TIM_TimeBaseInitTypeDef  TIM_TimeBaseStructure;</span><br><span class="line">    NVIC_InitTypeDef NVIC_InitStructure;</span><br><span class="line"></span><br><span class="line">    RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE); <span class="comment">//时钟使能</span></span><br></pre></td></tr></table></figure>

<p>为了使我们在运行程序时方便的更改TIM3/5的频率，我们只需要控制两个参数：arr和psc，其中arr为计数值，psc为分频值。将两个数据装入：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">TIM_TimeBaseStructure.TIM_Period = arr; <span class="comment">//设置在下一个更新事件装入活动的自动重装载寄存器周期的值   </span></span><br><span class="line">TIM_TimeBaseStructure.TIM_Prescaler =psc; <span class="comment">//设置用来作为TIMx时钟频率除数的预分频值</span></span><br></pre></td></tr></table></figure>

<p>并设置时钟分割和向上计数模式：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; <span class="comment">//设置时钟分割:TDTS = Tck_tim</span></span><br><span class="line">TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;  <span class="comment">//TIM向上计数模式</span></span><br></pre></td></tr></table></figure>

<p>接着使能并允许中断：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">TIM_TimeBaseInit(TIM3, &amp;TIM_TimeBaseStructure); <span class="comment">//根据指定的参数初始化TIMx的时间基数单位</span></span><br><span class="line"> </span><br><span class="line">TIM_ITConfig(TIM3,TIM_IT_Update,ENABLE ); <span class="comment">//使能指定的TIM3中断,允许更新中断</span></span><br></pre></td></tr></table></figure>

<p>下面是对TIM3中断的初始化，由于优先级相较于红外来说不高，且和蜂鸣器平级，所以我们随意设置主从优先级均为2即可：</p>
  <figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//中断优先级NVIC设置</span></span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn;  <span class="comment">//TIM3中断</span></span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = <span class="number">2</span>;  <span class="comment">//先占优先级0级</span></span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannelSubPriority = <span class="number">2</span>;  <span class="comment">//从优先级3级</span></span><br><span class="line">NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; <span class="comment">//IRQ通道被使能</span></span><br><span class="line">NVIC_Init(&amp;NVIC_InitStructure);  <span class="comment">//初始化NVIC寄存器</span></span><br></pre></td></tr></table></figure>



<p>接下来写TIM3的中断服务程序，只需要判断是更新中断后清除中断标志并将LED0和LED1取反即可：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//定时器3中断服务程序</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">TIM3_IRQHandler</span><span class="params">(<span class="keyword">void</span>)</span>   <span class="comment">//TIM3中断</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="keyword">if</span> (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET)  <span class="comment">//检查TIM3更新中断发生与否</span></span><br><span class="line">        &#123;</span><br><span class="line">        TIM_ClearITPendingBit(TIM3, TIM_IT_Update  );  <span class="comment">//清除TIMx更新中断标志 </span></span><br><span class="line">        LED1=!LED1;</span><br><span class="line">        LED0=!LED0;</span><br><span class="line">        &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>而TIM5与TIM3基本一致，在中断服务程序中，只需要将BEEP取反即可：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">BEEP=!BEEP;</span><br></pre></td></tr></table></figure>

<h4 id="Beep-h-Beep-c"><a href="#Beep-h-Beep-c" class="headerlink" title="Beep.h/Beep.c"></a>Beep.h/Beep.c</h4><p>由于BEEP与LED基本一致，唯一的区别就是GPIO为PB8，只需要将宏定义中设置为：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">define</span> BEEP PBout(8)   <span class="comment">// BEEP,蜂鸣器接口</span></span></span><br></pre></td></tr></table></figure>

<p>即可使用。</p>
<h4 id="LCD-h-LCD-c-font-h"><a href="#LCD-h-LCD-c-font-h" class="headerlink" title="LCD.h/LCD.c/font.h"></a>LCD.h/LCD.c/font.h</h4><p>由于该文件取自ATK官方例程，且代码繁多，将解释自己新增的部分代码和使用中的API函数进行一些简单说明。</p>
<p>由于该官方库并不带有实心圆画图函数，因此类比官方的LCD_Draw_Circle写了一个LCD_Draw_ALLCircle：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">LCD_Draw_ALLCircle</span><span class="params">(u16 x0,u16 y0,u8 r)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="keyword">int</span> a,b;</span><br><span class="line">    <span class="keyword">int</span> di;</span><br><span class="line">    a=<span class="number">0</span>;b=r;      </span><br><span class="line">    di=<span class="number">3</span>-(r&lt;&lt;<span class="number">1</span>);             <span class="comment">//??????????</span></span><br><span class="line">    <span class="keyword">while</span>(a&lt;=b)</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="keyword">int</span> i = a,p = b;</span><br><span class="line">        <span class="keyword">while</span>(i&gt;<span class="number">0</span>)&#123;     </span><br><span class="line">            LCD_DrawPoint(x0+b,y0-i);</span><br><span class="line">            LCD_DrawPoint(x0-i,y0+b);</span><br><span class="line">            i--;</span><br><span class="line">    &#125;       </span><br><span class="line">        <span class="keyword">while</span>(p&gt;<span class="number">0</span>)&#123;     </span><br><span class="line">            LCD_DrawPoint(x0-a,y0-p);</span><br><span class="line">            LCD_DrawPoint(x0-p,y0-a);</span><br><span class="line">            LCD_DrawPoint(x0+a,y0-p);</span><br><span class="line">            LCD_DrawPoint(x0-p,y0+a);</span><br><span class="line">            LCD_DrawPoint(x0+a,y0+p);</span><br><span class="line">            LCD_DrawPoint(x0+p,y0+a);</span><br><span class="line">            p--;</span><br><span class="line">    &#125;</span><br><span class="line">        a++;</span><br><span class="line">        <span class="comment">//Bresenham????    </span></span><br><span class="line">        <span class="keyword">if</span>(di&lt;<span class="number">0</span>)di +=<span class="number">4</span>*a+<span class="number">6</span>;   </span><br><span class="line">        <span class="keyword">else</span></span><br><span class="line">        &#123;</span><br><span class="line">            di+=<span class="number">10</span>+<span class="number">4</span>*(a-b);   </span><br><span class="line">            b--;</span><br><span class="line">        &#125;                           </span><br><span class="line">    &#125;</span><br><span class="line">    LCD_DrawPoint(x0,y0); <span class="comment">//????</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>使用的API：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">LCD_DrawPoint</span><span class="params">(u16 x,u16 y)</span></span>;   </span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">LCD_DrawRectangle</span><span class="params">(u16 x1, u16 y1, u16 x2, u16 y2)</span></span>; <span class="comment">//画矩形</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">LCD_Fill</span><span class="params">(u16 sx,u16 sy,u16 ex,u16 ey,u16 color)</span></span>; <span class="comment">//填充单色</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">LCD_ShowString</span><span class="params">(u16 x,u16 y,u16 <span class="built_in">width</span>,u16 <span class="built_in">height</span>,u8 <span class="built_in">size</span>,u8 *p)</span></span>;        <span class="comment">//显示一个字符串,12/16字体</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">LCD_ShowxNum</span><span class="params">(u16 x,u16 y,u32 num,u8 len,u8 <span class="built_in">size</span>,u8 mode)</span></span>;              <span class="comment">//显示 数字</span></span><br></pre></td></tr></table></figure>

<h3 id="8-运行效果展示"><a href="#8-运行效果展示" class="headerlink" title="8. 运行效果展示"></a>8. 运行效果展示</h3><p>针对实际运行结果拍照和录像，如下图所示：</p>
<p>图8.1：运行展示-POWEROFF</p>
<p><img src="http://pic.zhengqiao.wang/20200331133156.png" alt=""></p>
<p>图8.2：POWERON默认LED模式</p>
<p><img src="http://pic.zhengqiao.wang/20200331133208.png" alt=""></p>
<p>图8.3：左右切换至BEEP模式</p>
<p><img src="http://pic.zhengqiao.wang/20200331133215.png" alt=""></p>
<p>图8.4：左右切换至LED模式并上下切换至 3档和按下数字2切换流水灯模式</p>
<p><img src="http://pic.zhengqiao.wang/20200331133227.png" alt=""></p>
<h3 id="9-总结"><a href="#9-总结" class="headerlink" title="9.总结"></a>9.总结</h3><p>本次大实验我学习到了使用STM32配合库函数进行开发，虽然在大一实验室就已经开始接触STM32，但由于使用的更多的是STM32的串口功能做总线舵机开发，所以对于其他方面的应用，如LCD、红外、定时器的使用并不是很熟悉，对中断等实现的细节未掌握。</p>
<p>在本学期的学习中，我明白了ATK-STM32战舰版和旗舰版的基本使用方法，并能成功根据官方文档和示例程序开发出一套有使用价值的软件系统。在本学期的学习中，我学会了软延时、定时器、中断（更新中断和捕获中断）、GPIO、串口的使用方法，并将其应用至本次大实验中。</p>
<h3 id="10-附录"><a href="#10-附录" class="headerlink" title="10.附录"></a>10.附录</h3><p>视频演示地址：(暂时作废，等我上传B站吧)</p>
<p><del><a href="http://me.zhengqiao.wang/index.php/2019/12/18/嵌入式基于红外遥控的stm32声光系统/">http://me.zhengqiao.wang/index.php/2019/12/18/嵌入式基于红外遥控的stm32声光系统/</a></del> </p>
<p>代码地址：</p>
<p><a href="https://gitee.com/JogerQiao/ATK_STM32_20191218_Acoustooptic_system_of_infrared_remote_control.git">https://gitee.com/JogerQiao/ATK_STM32_20191218_Acoustooptic_system_of_infrared_remote_control.git</a></p>

            
        </div>
        
            <div style="text-align:left;font-size:14px;">
                <p style="text-align:center;color: #ccc;">-------------本文结束<i class="fas fa-eye"></i>感谢您的阅读-------------</p>
                
            </div>
            <ul class="post-copyright">
                <li class="post-copyright-license">
                    <strong>版权声明： </strong>
                    采用<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/">知识共享署名2.5</a>许可。<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/"><img alt="知识共享许可协议" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/2.5/cn/80x15.png" /></a>
                  </li>

                <li class="post-copyright-link">
                 <strong>本文作者：</strong>
                 王政乔
               </li>
       
               <li class="post-copyright-link">
                 <strong>本文标题：</strong>
                 STM32：基于红外遥控的声光系统
               </li>
       
               <li class="post-copyright-link">
                 <strong>本文链接：</strong>
                 https://www.zhengqiao.wang/2020-3-31-STM32：基于红外遥控的声光系统/
               </li>
       
               
             </ul>
        

        
        
        <div class="level is-size-7 is-uppercase">
            <div class="level-start">
                <div class="level-item">
                    <span class="is-size-6 has-text-grey has-mr-7">#</span>
                    <a class="has-link-grey -link" href="/tags/%E5%B5%8C%E5%85%A5%E5%BC%8F-STM32/" rel="tag">嵌入式 - STM32</a>
                </div>
            </div>
        </div>
        
        
        
        <div class="social-share"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css">
<script src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js"></script>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="menu-label has-text-centered">喜欢这篇文章？打赏一下作者吧</h3>
        <div class="buttons is-centered">
            
                
<a class="button is-info donate">
    <span class="icon is-small">
        <i class="fab fa-alipay"></i>
    </span>
    <span>支付宝</span>
    <div class="qrcode"><img src="/images/%E6%94%AF%E4%BB%98%E5%AE%9D%E6%94%B6%E6%AC%BE%E7%A0%81.jpg" alt="支付宝"></div>
</a>

                
                
<a class="button is-success donate">
    <span class="icon is-small">
        <i class="fab fa-weixin"></i>
    </span>
    <span>微信</span>
    <div class="qrcode"><img src="/images/%E5%BE%AE%E4%BF%A1%E8%B5%9E%E8%B5%8F%E7%A0%81.png" alt="微信"></div>
</a>

                
        </div>
    </div>
</div>



<div class="card card-transparent">
    <div class="level post-navigation is-flex-wrap is-mobile">
        
        <div class="level-start">
            <a class="level level-item has-link-grey  article-nav-prev" href="/2020-4-2-Python%EF%BC%9A%E3%80%90%E9%A2%84%E5%91%8A%E3%80%91%E4%BD%BF%E7%94%A8OpenCV%E8%AF%86%E5%88%AB%E4%BA%8C%E7%BB%B4%E7%A0%81/">
                <i class="level-item fas fa-chevron-left"></i>
                <span class="level-item">Python：使用OpenCV识别二维码</span>
            </a>
        </div>
        
        
        <div class="level-end">
            <a class="level level-item has-link-grey  article-nav-next" href="/2020-3-29-%E9%9A%8F%E7%AC%94%EF%BC%9A2020%E5%B9%B43%E6%9C%8829%E6%97%A5/">
                <span class="level-item">随笔：2020年3月29日</span>
                <i class="level-item fas fa-chevron-right"></i>
            </a>
        </div>
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="title is-5 has-text-weight-normal">评论</h3>
        
<div id="valine-thread" class="content"></div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js"></script>
<script>
    new Valine({
        el: '#valine-thread' ,
        notify: true,
        verify: true,
        app_id: 'DNC4dhA3KwUWSaeLWxwFjSmD-gzGzoHsz',
        app_key: 'ileLtaXmaLu8lsvqSqIAg195',
        placeholder: 'xxxxxxxx'
    });
</script>

    </div>
</div>

</div>
                




<div class="column is-4-tablet is-4-desktop is-3-widescreen  has-order-1 column-left is-sticky">
    
        
<div class="card widget">
    <div class="card-content">
        <nav class="level">
            <div class="level-item has-text-centered" style="flex-shrink: 1">
                <div>
                    
                    <figure class="image is-128x128 has-mb-6">
                        <img class="" src="/images/%E6%B1%9D%E7%AD%89%E7%9C%8B%E5%A5%BD%E6%88%91%E6%98%AF%E4%BD%A0%E4%B9%94%E5%93%A5%E7%81%B5%E5%8A%A8%E5%A4%B4%E5%83%8F.jpg" alt="王政乔">
                    </figure>
                    
                    <p class="is-size-4 is-block">
                        王政乔
                    </p>
                    
                    
                    <p class="is-size-6 is-block">
                        毕业啦！！！准备工作！
                    </p>
                    
                    
                    <p class="is-size-6 is-flex is-flex-center has-text-grey">
                        <i class="fas fa-map-marker-alt has-mr-7"></i>
                        <span>中华人民共和国 河南省 郑州市</span>
                    </p>
                    
                </div>
            </div>
        </nav>
        <nav class="level is-mobile">
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        文章
                    </p>
                    <a href="/archives">
                        <p class="title has-text-weight-normal">
                            67
                        </p>
                    </a>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        分类
                    </p>
                    <a href="/categories">
                        <p class="title has-text-weight-normal">
                            17
                        </p>
                    </a>
                </div>
            </div>
            <div class="level-item has-text-centered is-marginless">
                <div>
                    <p class="heading">
                        标签
                    </p>
                    <a href="/tags">
                        <p class="title has-text-weight-normal">
                            48
                        </p>
                    </a>
                </div>
            </div>
        </nav>
        
        <div class="level">
            <a class="level-item button is-link is-rounded" href="https://gitee.com/JogerQiao" target="_blank" rel="noopener">
                关注我</a>
        </div>
        
        
        
        <div class="level is-mobile">
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="Gitee" href="https://gitee.com/JogerQiao">
                
                <i class="iconfont icon-gitee-fill-round"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="知乎" href="https://www.zhihu.com/people/joger-81">
                
                <i class="iconfont icon-zhihu"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="我的邮箱" href="mailto:me@zhengqiao.wang">
                
                <i class="iconfont icon-mail"></i>
                
            </a>
            
            <a class="level-item button is-white is-marginless" target="_blank" rel="noopener"
                title="Bilibili" href="https://space.bilibili.com/83542572">
                
                <i class="iconfont icon-bilibili-line"></i>
                
            </a>
            
        </div>
        
    </div>
</div>
    
        

    <div class="card widget" id="toc">
        <div class="card-content">
            <div class="menu">
                <h3 class="menu-label">
                    目录
                </h3>
                <ul class="menu-list"><li>
        <a class="is-flex" href="#大实验-基于红外遥控的声光系统">
        <span class="has-mr-6">1</span>
        <span>大实验 基于红外遥控的声光系统</span>
        </a><ul class="menu-list"><li>
        <a class="is-flex" href="#1-实验目的">
        <span class="has-mr-6">1.1</span>
        <span>1.实验目的</span>
        </a></li><li>
        <a class="is-flex" href="#2-项目名称">
        <span class="has-mr-6">1.2</span>
        <span>2.项目名称</span>
        </a></li><li>
        <a class="is-flex" href="#3-项目内容">
        <span class="has-mr-6">1.3</span>
        <span>3.项目内容</span>
        </a></li><li>
        <a class="is-flex" href="#4-项目设备">
        <span class="has-mr-6">1.4</span>
        <span>4.项目设备</span>
        </a></li><li>
        <a class="is-flex" href="#5-实现功能和涉及技术">
        <span class="has-mr-6">1.5</span>
        <span>5.实现功能和涉及技术</span>
        </a><ul class="menu-list"><li>
        <a class="is-flex" href="#功能描述">
        <span class="has-mr-6">1.5.1</span>
        <span>功能描述</span>
        </a></li><li>
        <a class="is-flex" href="#涉及技术">
        <span class="has-mr-6">1.5.2</span>
        <span>涉及技术</span>
        </a></li></ul></li><li>
        <a class="is-flex" href="#6-逻辑和流程图">
        <span class="has-mr-6">1.6</span>
        <span>6.逻辑和流程图</span>
        </a></li><li>
        <a class="is-flex" href="#7-核心代码说明">
        <span class="has-mr-6">1.7</span>
        <span>7.核心代码说明</span>
        </a><ul class="menu-list"><li>
        <a class="is-flex" href="#Main-c">
        <span class="has-mr-6">1.7.1</span>
        <span>Main.c</span>
        </a></li><li>
        <a class="is-flex" href="#LED-h-LED-c">
        <span class="has-mr-6">1.7.2</span>
        <span>LED.h/LED.c</span>
        </a></li><li>
        <a class="is-flex" href="#Remote-h-Remote-c">
        <span class="has-mr-6">1.7.3</span>
        <span>Remote.h/Remote.c</span>
        </a></li><li>
        <a class="is-flex" href="#Timer-h-Timer-c">
        <span class="has-mr-6">1.7.4</span>
        <span>Timer.h/Timer.c</span>
        </a></li><li>
        <a class="is-flex" href="#Beep-h-Beep-c">
        <span class="has-mr-6">1.7.5</span>
        <span>Beep.h/Beep.c</span>
        </a></li><li>
        <a class="is-flex" href="#LCD-h-LCD-c-font-h">
        <span class="has-mr-6">1.7.6</span>
        <span>LCD.h/LCD.c/font.h</span>
        </a></li></ul></li><li>
        <a class="is-flex" href="#8-运行效果展示">
        <span class="has-mr-6">1.8</span>
        <span>8. 运行效果展示</span>
        </a></li><li>
        <a class="is-flex" href="#9-总结">
        <span class="has-mr-6">1.9</span>
        <span>9.总结</span>
        </a></li><li>
        <a class="is-flex" href="#10-附录">
        <span class="has-mr-6">1.10</span>
        <span>10.附录</span>
        </a></li></ul></li></ul>
            </div>
        </div>
    </div>

    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            链接
        </h3>
        <ul class="menu-list">
        
            <li>
                <a class="level is-mobile" href="https://hexo.io" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">Hexo</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">hexo.io</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://github.com/ppoffice" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">PPOffice</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">github.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="http://mtics.top" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">李志伟-吾人为学</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">mtics.top</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://expoli.tech/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">糖醋鱼</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">expoli.tech</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://zzuyy519blog.top/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">羊老头</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">zzuyy519blog.top</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://shuangzu.top/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">郑州大学双足实验室</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">shuangzu.top</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://www.leeyiding.com/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">LeeYD · Blog</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">www.leeyiding.com</span>
                    </span>
                </a>
            </li>
        
            <li>
                <a class="level is-mobile" href="https://shiyousan.com/" target="_blank" rel="noopener">
                    <span class="level-left">
                        <span class="level-item">十有三</span>
                    </span>
                    <span class="level-right">
                        <span class="level-item tag">shiyousan.com</span>
                    </span>
                </a>
            </li>
        
        </ul>
        </div>
    </div>
</div>

    
    
        <div class="column-right-shadow is-hidden-widescreen ">
        
            
<div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                分类
            </h3>
            <ul class="menu-list">
            <li>
        <a class="level is-marginless" href="/categories/%E5%85%AC%E5%91%8A/">
            <span class="level-start">
                <span class="level-item">公告</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/">
            <span class="level-start">
                <span class="level-item">技术分享</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">58</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Android/">
            <span class="level-start">
                <span class="level-item">Android</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/C/">
            <span class="level-start">
                <span class="level-item">C++</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">14</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Docker/">
            <span class="level-start">
                <span class="level-item">Docker</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Java/">
            <span class="level-start">
                <span class="level-item">Java</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">6</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Linux/">
            <span class="level-start">
                <span class="level-item">Linux</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/NAO/">
            <span class="level-start">
                <span class="level-item">NAO</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">7</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Python/">
            <span class="level-start">
                <span class="level-item">Python</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E5%89%8D%E7%AB%AF/">
            <span class="level-start">
                <span class="level-item">前端</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E5%8C%BB%E5%AD%A6%E5%9B%BE%E5%83%8F/">
            <span class="level-start">
                <span class="level-item">医学图像</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">
            <span class="level-start">
                <span class="level-item">机器学习</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E6%A0%91%E8%8E%93%E6%B4%BE/">
            <span class="level-start">
                <span class="level-item">树莓派</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/">
            <span class="level-start">
                <span class="level-item">课程设计</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/%E5%B5%8C%E5%85%A5%E5%BC%8F/">
            <span class="level-start">
                <span class="level-item">嵌入式</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86/">
            <span class="level-start">
                <span class="level-item">编译原理</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/%E9%9A%8F%E7%AC%94/">
            <span class="level-start">
                <span class="level-item">随笔</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li>
            </ul>
        </div>
    </div>
</div>
        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            归档
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2020/10/">
                <span class="level-start">
                    <span class="level-item">十月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/05/">
                <span class="level-start">
                    <span class="level-item">五月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/04/">
                <span class="level-start">
                    <span class="level-item">四月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/03/">
                <span class="level-start">
                    <span class="level-item">三月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">18</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/11/">
                <span class="level-start">
                    <span class="level-item">十一月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/10/">
                <span class="level-start">
                    <span class="level-item">十月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/09/">
                <span class="level-start">
                    <span class="level-item">九月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/08/">
                <span class="level-start">
                    <span class="level-item">八月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/06/">
                <span class="level-start">
                    <span class="level-item">六月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/04/">
                <span class="level-start">
                    <span class="level-item">四月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/03/">
                <span class="level-start">
                    <span class="level-item">三月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/02/">
                <span class="level-start">
                    <span class="level-item">二月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/12/">
                <span class="level-start">
                    <span class="level-item">十二月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/11/">
                <span class="level-start">
                    <span class="level-item">十一月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/10/">
                <span class="level-start">
                    <span class="level-item">十月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">9</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/05/">
                <span class="level-start">
                    <span class="level-item">五月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/04/">
                <span class="level-start">
                    <span class="level-item">四月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/03/">
                <span class="level-start">
                    <span class="level-item">三月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/02/">
                <span class="level-start">
                    <span class="level-item">二月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
        
            <div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                标签
            </h3>
            <div class="field is-grouped is-grouped-multiline">
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/AX-12/">
                        <span class="tag">AX-12</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Android/">
                        <span class="tag">Android</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Bluetooth/">
                        <span class="tag">Bluetooth</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/C/">
                        <span class="tag">C++</span>
                        <span class="tag is-grey">15</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CSI%E6%91%84%E5%83%8F%E5%A4%B4/">
                        <span class="tag">CSI摄像头</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CSS/">
                        <span class="tag">CSS</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CV/">
                        <span class="tag">CV</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Choregraphe/">
                        <span class="tag">Choregraphe</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/DCMTK/">
                        <span class="tag">DCMTK</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Docker/">
                        <span class="tag">Docker</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/HTML/">
                        <span class="tag">HTML</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Handle/">
                        <span class="tag">Handle</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Hexo/">
                        <span class="tag">Hexo</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/IDEA/">
                        <span class="tag">IDEA</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Java/">
                        <span class="tag">Java</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/JavaScript/">
                        <span class="tag">JavaScript</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Linux/">
                        <span class="tag">Linux</span>
                        <span class="tag is-grey">5</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Mysql/">
                        <span class="tag">Mysql</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/NAO/">
                        <span class="tag">NAO</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/NAO%E6%9C%BA%E5%99%A8%E4%BA%BA/">
                        <span class="tag">NAO机器人</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Nao/">
                        <span class="tag">Nao</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/OpenCV/">
                        <span class="tag">OpenCV</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Python/">
                        <span class="tag">Python</span>
                        <span class="tag is-grey">8</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Python-Pip/">
                        <span class="tag">Python - Pip</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Qt/">
                        <span class="tag">Qt</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Raspberry-Pi-3b/">
                        <span class="tag">Raspberry Pi 3b</span>
                        <span class="tag is-grey">5</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/SDK/">
                        <span class="tag">SDK</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/SVM/">
                        <span class="tag">SVM</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Shell/">
                        <span class="tag">Shell</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Tensorflow/">
                        <span class="tag">Tensorflow</span>
                        <span class="tag is-grey">3</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Tomcat/">
                        <span class="tag">Tomcat</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Unix/">
                        <span class="tag">Unix</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/VSCode/">
                        <span class="tag">VSCode</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/WordPress/">
                        <span class="tag">WordPress</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/python/">
                        <span class="tag">python</span>
                        <span class="tag is-grey">8</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/ssh/">
                        <span class="tag">ssh</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E4%BB%A3%E7%A0%81%E5%AD%98%E6%A1%A3/">
                        <span class="tag">代码存档</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%8C%BB%E5%AD%A6%E5%9B%BE%E5%83%8F/">
                        <span class="tag">医学图像</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%A4%A7%E6%95%B0%E6%8D%AE/">
                        <span class="tag">大数据</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%B5%8C%E5%85%A5%E5%BC%8F-STM32/">
                        <span class="tag">嵌入式 - STM32</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%8B%A6%E6%88%AA%E5%99%A8/">
                        <span class="tag">拦截器</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%95%99%E7%A8%8B/">
                        <span class="tag">教程</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%89%B9%E5%BE%81%E5%B7%A5%E7%A8%8B/">
                        <span class="tag">特征工程</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93/">
                        <span class="tag">第三方库</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%BA%A2%E7%90%83%E6%A3%80%E6%B5%8B/">
                        <span class="tag">红球检测</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86/">
                        <span class="tag">编译原理</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/">
                        <span class="tag">解决方案</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%9A%8F%E7%AC%94/">
                        <span class="tag">随笔</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
            </div>
        </div>
    </div>
</div>
        
        </div>
    
</div>

                




<div class="column is-4-tablet is-4-desktop is-3-widescreen is-hidden-touch is-hidden-desktop-only has-order-3 column-right ">
    
        
<div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                分类
            </h3>
            <ul class="menu-list">
            <li>
        <a class="level is-marginless" href="/categories/%E5%85%AC%E5%91%8A/">
            <span class="level-start">
                <span class="level-item">公告</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/">
            <span class="level-start">
                <span class="level-item">技术分享</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">58</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Android/">
            <span class="level-start">
                <span class="level-item">Android</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/C/">
            <span class="level-start">
                <span class="level-item">C++</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">14</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Docker/">
            <span class="level-start">
                <span class="level-item">Docker</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Java/">
            <span class="level-start">
                <span class="level-item">Java</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">6</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Linux/">
            <span class="level-start">
                <span class="level-item">Linux</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/NAO/">
            <span class="level-start">
                <span class="level-item">NAO</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">7</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/Python/">
            <span class="level-start">
                <span class="level-item">Python</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E5%89%8D%E7%AB%AF/">
            <span class="level-start">
                <span class="level-item">前端</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E5%8C%BB%E5%AD%A6%E5%9B%BE%E5%83%8F/">
            <span class="level-start">
                <span class="level-item">医学图像</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">2</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">
            <span class="level-start">
                <span class="level-item">机器学习</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/%E6%A0%91%E8%8E%93%E6%B4%BE/">
            <span class="level-start">
                <span class="level-item">树莓派</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">5</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/">
            <span class="level-start">
                <span class="level-item">课程设计</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a><ul><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/%E5%B5%8C%E5%85%A5%E5%BC%8F/">
            <span class="level-start">
                <span class="level-item">嵌入式</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">1</span>
            </span>
        </a></li><li>
        <a class="level is-marginless" href="/categories/%E8%AF%BE%E7%A8%8B%E8%AE%BE%E8%AE%A1/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86/">
            <span class="level-start">
                <span class="level-item">编译原理</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">3</span>
            </span>
        </a></li></ul></li><li>
        <a class="level is-marginless" href="/categories/%E9%9A%8F%E7%AC%94/">
            <span class="level-start">
                <span class="level-item">随笔</span>
            </span>
            <span class="level-end">
                <span class="level-item tag">4</span>
            </span>
        </a></li>
            </ul>
        </div>
    </div>
</div>
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            归档
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2020/10/">
                <span class="level-start">
                    <span class="level-item">十月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/05/">
                <span class="level-start">
                    <span class="level-item">五月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/04/">
                <span class="level-start">
                    <span class="level-item">四月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2020/03/">
                <span class="level-start">
                    <span class="level-item">三月 2020</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">18</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/11/">
                <span class="level-start">
                    <span class="level-item">十一月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/10/">
                <span class="level-start">
                    <span class="level-item">十月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/09/">
                <span class="level-start">
                    <span class="level-item">九月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/08/">
                <span class="level-start">
                    <span class="level-item">八月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/06/">
                <span class="level-start">
                    <span class="level-item">六月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/04/">
                <span class="level-start">
                    <span class="level-item">四月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/03/">
                <span class="level-start">
                    <span class="level-item">三月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2019/02/">
                <span class="level-start">
                    <span class="level-item">二月 2019</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">4</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/12/">
                <span class="level-start">
                    <span class="level-item">十二月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/11/">
                <span class="level-start">
                    <span class="level-item">十一月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/10/">
                <span class="level-start">
                    <span class="level-item">十月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">9</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/05/">
                <span class="level-start">
                    <span class="level-item">五月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/04/">
                <span class="level-start">
                    <span class="level-item">四月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/03/">
                <span class="level-start">
                    <span class="level-item">三月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/02/">
                <span class="level-start">
                    <span class="level-item">二月 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
            <h3 class="menu-label">
                标签
            </h3>
            <div class="field is-grouped is-grouped-multiline">
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/AX-12/">
                        <span class="tag">AX-12</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Android/">
                        <span class="tag">Android</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Bluetooth/">
                        <span class="tag">Bluetooth</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/C/">
                        <span class="tag">C++</span>
                        <span class="tag is-grey">15</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CSI%E6%91%84%E5%83%8F%E5%A4%B4/">
                        <span class="tag">CSI摄像头</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CSS/">
                        <span class="tag">CSS</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/CV/">
                        <span class="tag">CV</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Choregraphe/">
                        <span class="tag">Choregraphe</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/DCMTK/">
                        <span class="tag">DCMTK</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Docker/">
                        <span class="tag">Docker</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/HTML/">
                        <span class="tag">HTML</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Handle/">
                        <span class="tag">Handle</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Hexo/">
                        <span class="tag">Hexo</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/IDEA/">
                        <span class="tag">IDEA</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Java/">
                        <span class="tag">Java</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/JavaScript/">
                        <span class="tag">JavaScript</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Linux/">
                        <span class="tag">Linux</span>
                        <span class="tag is-grey">5</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Mysql/">
                        <span class="tag">Mysql</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/NAO/">
                        <span class="tag">NAO</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/NAO%E6%9C%BA%E5%99%A8%E4%BA%BA/">
                        <span class="tag">NAO机器人</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Nao/">
                        <span class="tag">Nao</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/OpenCV/">
                        <span class="tag">OpenCV</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Python/">
                        <span class="tag">Python</span>
                        <span class="tag is-grey">8</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Python-Pip/">
                        <span class="tag">Python - Pip</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Qt/">
                        <span class="tag">Qt</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Raspberry-Pi-3b/">
                        <span class="tag">Raspberry Pi 3b</span>
                        <span class="tag is-grey">5</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/SDK/">
                        <span class="tag">SDK</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/SVM/">
                        <span class="tag">SVM</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Shell/">
                        <span class="tag">Shell</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Tensorflow/">
                        <span class="tag">Tensorflow</span>
                        <span class="tag is-grey">3</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Tomcat/">
                        <span class="tag">Tomcat</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/Unix/">
                        <span class="tag">Unix</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/VSCode/">
                        <span class="tag">VSCode</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/WordPress/">
                        <span class="tag">WordPress</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/python/">
                        <span class="tag">python</span>
                        <span class="tag is-grey">8</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/ssh/">
                        <span class="tag">ssh</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E4%BB%A3%E7%A0%81%E5%AD%98%E6%A1%A3/">
                        <span class="tag">代码存档</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%8C%BB%E5%AD%A6%E5%9B%BE%E5%83%8F/">
                        <span class="tag">医学图像</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%A4%A7%E6%95%B0%E6%8D%AE/">
                        <span class="tag">大数据</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E5%B5%8C%E5%85%A5%E5%BC%8F-STM32/">
                        <span class="tag">嵌入式 - STM32</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%8B%A6%E6%88%AA%E5%99%A8/">
                        <span class="tag">拦截器</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E6%95%99%E7%A8%8B/">
                        <span class="tag">教程</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%89%B9%E5%BE%81%E5%B7%A5%E7%A8%8B/">
                        <span class="tag">特征工程</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BA%93/">
                        <span class="tag">第三方库</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%BA%A2%E7%90%83%E6%A3%80%E6%B5%8B/">
                        <span class="tag">红球检测</span>
                        <span class="tag is-grey">1</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86/">
                        <span class="tag">编译原理</span>
                        <span class="tag is-grey">2</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/">
                        <span class="tag">解决方案</span>
                        <span class="tag is-grey">6</span>
                    </a>
                </div>
                
                <div class="control">
                    <a class="tags has-addons" href="/tags/%E9%9A%8F%E7%AC%94/">
                        <span class="tag">随笔</span>
                        <span class="tag is-grey">4</span>
                    </a>
                </div>
                
            </div>
        </div>
    </div>
</div>
    
    
</div>

            </div>
        </div>
    </section>
    <!--
 * @Descripttion: 
 * @version: 
 * @Author: 王政乔(https://www.zhengqiao.wang/)
 * @Date: 2020-03-25 10:59:52
 * @LastEditors: 王政乔(https://www.zhengqiao.wang/)
 * @LastEditTime: 2020-03-26 10:51:19
 -->
<footer class="footer">

    <div class="container">
        <div class="level">
            <div class="level-start has-text-centered-mobile">
                <a class="footer-logo is-block has-mb-6" href="/">
                
                    王政乔|中国
                
                </a>
                <p class="is-size-7">
                <a href='http://www.beian.miit.gov.cn/' >豫ICP备18045451号-1</a>&nbsp;
                &copy; 2020 王政乔&nbsp;
                Powered by <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> & <a
                        href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="noopener">Icarus</a>
                        
                
                </p>
            </div>
            <div class="level-end">
            
                <div class="field has-addons is-flex-center-mobile has-mt-5-mobile is-flex-wrap is-flex-middle">
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="访问我的Gitee" href="https://gitee.com/JogerQiao">
                        
                        <i class="iconfont icon-gitee-fill-round"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="我的邮箱" href="mailto:me@zhengqiao.wang">
                        
                        <i class="iconfont icon-mail"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="Bilibili" href="https://space.bilibili.com/83542572">
                        
                        <i class="iconfont icon-bilibili-line"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="知乎" href="https://www.zhihu.com/people/joger-81">
                        
                        <i class="iconfont icon-zhihu"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" rel="noopener" title="SZ" href="http://jun.zhengqiao.wang/">
                        
                        <i class="iconfont icon-setting"></i>
                        
                    </a>
                </p>
                
                </div>
            
            </div>
        </div>
    </div>
    <script>
        (function () {
            var bp = document.createElement('script');
            var curProtocol = window.location.protocol.split(':')[0];
            if (curProtocol === 'https') {
                bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
            }
            else {
                bp.src = 'http://push.zhanzhang.baidu.com/push.js';
            }
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(bp, s);
        })();
    </script>

</footer>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script>
<script>moment.locale("zh-CN");</script>


<script>
var IcarusThemeSettings = {
    site: {
        url: 'https://www.zhengqiao.wang',
        external_link: {"enable":true,"exclude":[]}
    },
    article: {
        highlight: {
            clipboard: true,
            fold: 'unfolded'
        }
    }
};
</script>


<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script>





<script src="/js/animation.js"></script>



<script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script>
<script src="/js/gallery.js" defer></script>



<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update
            my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer></script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        });
    });
</script>


<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
    MathJax.Hub.Config({
        'HTML-CSS': {
            matchFontHeight: false
        },
        SVG: {
            matchFontHeight: false
        },
        CommonHTML: {
            matchFontHeight: false
        },
        tex2jax: {
            inlineMath: [
                ['$','$'],
                ['\\(','\\)']
            ]
        }
    });
});
</script>


<a id="back-to-top" title="回到顶端" href="javascript:;">
    <i class="fas fa-chevron-up"></i>
</a>
<script src="/js/back-to-top.js" defer></script>














<script src="/js/main.js" defer></script>

    
    <div class="searchbox ins-search">
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="想要查找什么..." />
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: '文章',
                PAGES: '页面',
                CATEGORIES: '分类',
                TAGS: '标签',
                UNTITLED: '(无标题)',
            },
            CONTENT_URL: '/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/js/insight.js" defer></script>
<link rel="stylesheet" href="/css/search.css">
<link rel="stylesheet" href="/css/insight.css">
    
</body>
</html>